package com.zt.mapper;

import com.zt.pojo.Checkitem;
import com.zt.pojo.vo.CheckitemVo;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
* @author 不.凌
* @description 针对表【t_checkitem】的数据库操作Mapper
* @createDate 2024-11-17 19:36:06
* @Entity com.zt.domain.Checkitem
*/
@Mapper
public interface CheckitemMapper{
    /**
     * 分页模糊查询
     * @param checkitemVo
     * @return
     */
//    @Select("SELECT * FROM t_checkitem where code LIKE '%${code}%' AND name LIKE '%${name}%'")
    List<Checkitem> findPage(CheckitemVo checkitemVo);

    /**
     * 添加检查项
     * @param checkitem
     * @return
     */
    @Insert("INSERT INTO t_checkitem(id,code,name,sex,age,price,type,attention,remark) values(#{id},#{code},#{name},#{sex},#{age},#{price},#{type},#{attention},#{remark})")
    int add(Checkitem checkitem);

    /**
     * 删除检查项
     * @param id
     * @return
     */
    @Delete("DELETE FROM t_checkitem WHERE id = #{id}")
    int delete(Integer id);

    /**
     * 修改检查项
     * @param checkitem
     * @return
     */
    @Update("update t_checkitem set code = #{code},name = #{name},sex = #{sex},age = #{age},price = #{price},type = #{type},attention = #{attention},remark = #{remark} where id = #{id}")
    int update(Checkitem checkitem);

    /**
     * 根据id查询检查项
     * @param id
     * @return
     */
    @Select("select * from t_checkitem where id = #{id}")
    Checkitem findById(Integer id);
    /**
     * 查询所有检查项
     * @return
     */
    List<Checkitem> findAll();
    void deleteCheckGroupCheckItemByCheckItemId( Integer id );
}




